home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / OutOfPhase1.01Source / OutOfPhase Folder / OscBankPlayer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  3.6 KB  |  99 lines  |  [TEXT/KAHL]

  1. /* OscBankPlayer.h */
  2.  
  3. #ifndef Included_OscBankPlayer_h
  4. #define Included_OscBankPlayer_h
  5.  
  6. /* OscBankPlayer module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* FixedPoint */
  12. /* LFOGenerator */
  13. /* BinaryCodedDecimal */
  14. /* IncrementalParameterUpdator */
  15. /* LFOSpecifier */
  16. /* LFOListSpecifier */
  17. /* Memory */
  18. /* Array */
  19. /* OscillatorListSpecifier */
  20. /* OscillatorSpecifier */
  21. /* InstrumentStructure */
  22. /* GenInstrTopology */
  23. /* SampleOscControl */
  24. /* WaveTableOscControl */
  25. /* ModulationOscControl */
  26. /* DeterminedNoteStructure */
  27. /* NoteObject */
  28. /* FloatingPoint */
  29. /* Frequency */
  30. /* ErrorDaemon */
  31.  
  32. #include "FixedPoint.h"
  33. #include "BinaryCodedDecimal.h"
  34.  
  35. struct OscBankTemplateRec;
  36. typedef struct OscBankTemplateRec OscBankTemplateRec;
  37.  
  38. struct OscStateBankRec;
  39. typedef struct OscStateBankRec OscStateBankRec;
  40.  
  41. /* forwards */
  42. struct InstrumentRec;
  43. struct IncrParamUpdateRec;
  44. struct NoteObjectRec;
  45. struct FrozenNoteRec;
  46. struct ErrorDaemonRec;
  47.  
  48. /* flush all cached oscillator state bank records */
  49. void                                    FlushCachedOscStateBankRecords(void);
  50.  
  51. /* construct an oscillator bank template record.  various parameters are passed in */
  52. /* which are needed for synthesis.  ParameterUpdator is the parameter information */
  53. /* record for the whole track of which this is a part. */
  54. OscBankTemplateRec*        NewOscBankTemplate(struct InstrumentRec* InstrumentDefinition,
  55.                                                 MyBoolean StereoFlag, LargeBCDType OverallVolumeScalingReciprocal,
  56.                                                 long SamplingRate, float EnvelopeRate, MyBoolean TimeInterp,
  57.                                                 MyBoolean WaveInterp, struct IncrParamUpdateRec* ParameterUpdator,
  58.                                                 struct ErrorDaemonRec* ErrorDaemon);
  59.  
  60. /* dispose of the template */
  61. void                                    DisposeOscBankTemplate(OscBankTemplateRec* Template);
  62.  
  63. /* construct a new oscillator bank state object based on the note.  the note is */
  64. /* assumed to start "now" in terms of the parameters in the ParameterUpdator.  */
  65. /* *WhenToStartPlayingOut returns a negative number that represents how much */
  66. /* before "now" the note should start playing. */
  67. /*     <already played>       |    <scanning gap>     |    <not yet analyzed> */
  68. /*   time ---->    time ---->    time ---->    time ---->    time ---->   time ----> */
  69. /*                            ^A                      ^B     */
  70. /* point A is the back edge of the scanning gap.  as this edge moves forward in time, */
  71. /*   oscillator bank state objects are removed from the queue and playback is commenced */
  72. /*   for them. */
  73. /* point B is the front edge of the scanning gap.  as this edge moves forward in time, */
  74. /*   notes are extracted from the track and state bank objects are created for them. */
  75. /*   ParameterUpdator always reflects parameters at this point in time. */
  76. OscStateBankRec*            NewOscBankState(OscBankTemplateRec* Template,
  77.                                                 long* WhenToStartPlayingOut, struct NoteObjectRec* Note,
  78.                                                 float EnvelopeTicksPerDurationTick);
  79.  
  80. /* this is used for resetting a note for a tie */
  81. /* the FrozenNote object is NOT disposed */
  82. MyBoolean                            ResetOscBankState(OscStateBankRec* State,
  83.                                                 struct FrozenNoteRec* FrozenNote,
  84.                                                 float EnvelopeTicksPerDurationTick);
  85.  
  86. /* get rid of a state bank */
  87. void                                    DisposeOscStateBank(OscStateBankRec* State);
  88.  
  89. /* get the reference to the note that this bank ties to.  NIL if it doesn't */
  90. struct NoteObjectRec*    GetOscStateTieTarget(OscStateBankRec* State);
  91.  
  92. /* perform one envelope clock cycle on a state bank.  this returns True if the */
  93. /* state bank is done and should be retired.  (it will return false if it is a */
  94. /* tie source.) */
  95. MyBoolean                            UpdateOscStateBank(OscStateBankRec* State, long NumFrames,
  96.                                                 largefixedsigned* OutputData);
  97.  
  98. #endif
  99.